package com.mobilad.model;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.simple.ParameterizedRowMapper;

public class UserRowMapper implements ParameterizedRowMapper<User> {

	@Override
	public User mapRow(ResultSet rs, int rowNum) throws SQLException {
		User user = new UserImp();
		user.setUserId(rs.getInt("user_id"));
		user.setUserName(rs.getString("user_name"));
		user.setAddress(rs.getString("address"));
		user.setPostalcode(rs.getString("postalcode"));
		user.setCity(rs.getString("city"));
		user.setMobNr(rs.getString("mob_nr"));
		user.setPwd(rs.getString("pwd"));
		user.setMobModel(rs.getString("mob_model"));
		user.setMobModelNr(rs.getString("mob_model_nr"));
		user.setEmailAddress(rs.getString("email_address"));
		user.setEnabled(rs.getBoolean("enabled"));
		
		return user;
	}

	
}
